﻿using System;
using System.Windows.Controls;
using jSLCore.Client.Presentation.BaseControl.DialogMessage;
using jSLCore.Client.Presentation.BaseControl.Selection;

namespace jSLApp.Client.Wpf.Forms
{
    /// <summary>
    /// Interaction logic for StringList.xaml
    /// </summary>
    public partial class StringList : SelectControl
    {
        public StringList()
        {
            InitializeComponent();
        }

        public override ISelectableGrid GetSelectableGrid()
        {
            return grid;
        }

        public override void LoadInitialData()
        {
            #region itemsSource
            grid.ItemsSource = new[]
                                   {
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4","String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                       "String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4","String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4","String 1", 
                                       "String 2",
                                       "String 3", 
                                       "String 4",
                                   };
            #endregion
        }

        public override Control GetControlForInitialFocus()
        {
            return grid;
        }

        private void showSmth(object sender, RowSelectedEventArgs e)
        {
            InfoBox.ShowDialog((string) e.RowObject, this);
        }

        private void goDetails_Clicked(object sender, RowSelectedEventArgs e)
        {
            InfoBox.ShowDialog((string) e.RowObject,this);
        }
    }
}
